<?php if ( ! defined('BASEPATH')) exit('This file does not run directly. Sorry.'); ?>
<?php
/**
 * Kalaisoo.
 *
 * A lightweight no-framework framework written in PHP.
 *
 * @package Kalaisoo
 * @author $Author: info@sah-company.com $
 * @version $Id: test.php 126 2012-01-11 20:59:15Z info@sah-company.com $
 */

/**
 * Kalaisoo Test Controller Class.
 *
 * @package Kalaisoo
 * @subpackage Controller
 * @author $Author: info@sah-company.com $
 * @see app/config/config.php
 */
class Test_Controller extends Controller
{
	/**
	 * @var mixed
	 */
	protected $bean;

	/**
	 * construct a new Test_Controller.
	 */
	public function __construct()
	{
		parent::__construct();
		$this->registry->cache->setLifetime(0);
		$this->registry->loader->lib(array('redbean', 'gestalt'));
		$this->registry->loader->helper(array('url'));
		$this->registry->loader->helper('textile');
		$this->data['scripts'][] = 'jquery/jquery-1.6.2.min';
		$this->data['scripts'][] = 'core';
		$this->data['scripts'][] = 'editor';
		$this->template = new Template();
	}
	
	/**
	 * outputs the test template.
	 */
	public function index($type, $id)
	{
		$this->registry->loader->model($type, true);
		$this->data['record'] = R::load($type, $id);
		$this->data['gestalt'] = new Gestalt($this->data['record'], 'default');
		$this->template->view('test', $this->data);
	}
}
?>